#ifndef __PTGUI_SYSTEM_H__
#define __PTGUI_SYSTEM_H__

void ptgui_assert(const rt_int8_t *str, rt_int32_t line);
void ptgui_system_init();

struct ptgui_thread
{
	/* the thread id */
	rt_thread_t	tid;

	/* the message queue of thread */
	rt_mq_t		mq;

	/* the owner of thread */
	void		*owner;
};
typedef struct ptgui_thread ptgui_thread_t;

struct ptgui_timer;
typedef void (*ptgui_timeout_func)(struct ptgui_timer *timer, void *parameter);

struct ptgui_timer
{
	/* context thread id */
	rt_thread_t			tid;
	/* rt timer */
	struct rt_timer		timer;

	/* timeout function and user data */
	ptgui_timeout_func	timeout;
	void				*user_data;
};
typedef struct ptgui_timer ptgui_timer_t;

ptgui_timer_t *ptgui_timer_create(rt_int32_t time, rt_base_t flag, ptgui_timeout_func timeout, void *parameter);
void ptgui_timer_destory(ptgui_timer_t *timer);

void ptgui_timer_start(ptgui_timer_t *timer);
void ptgui_timer_stop(ptgui_timer_t *timer);

#endif

